<template>
   <!-- 头部部分 -->
    <header class="header">
      <h1>todos</h1>
      <input class="new-todo" placeholder="请输入任务名称" autofocus @keyup.enter='addList' v-model='todoList'/>
    </header>
</template>
 
<script>
export default {
  name: "headerComponent",
  components: {},
  props: {},
  data() {
    return {
      todoList:''
    };
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    addList(){
      this.$emit('addList',this.todoList)
      this.todoList=''
    }
  }
};
</script>

<style scoped>
     
</style>